from django.contrib import admin

# Register your models here.
from .models import Article,Category,Tag,Links
from pagedown.widgets import AdminPagedownWidget
from django import forms

class ArticleAdmin(admin.ModelAdmin):
    list_display = ['title', 'created_time', 'last_mod_time', 'category','author']

# 这种方式暂时不知道为啥不行,后边再进行调整
# class ArticleForm(forms.ModelForm):
#     body = forms.CharField(widget=AdminPagedownWidget())
#
#     class Meta:
#         model = Article
#         fields = '__all__'
#         # fields = ['title', 'created_time', 'last_mod_time', 'category', 'author']


# class ArticleAdmin(admin.ModelAdmin):
#     form = ArticleForm

admin.site.register(Article, ArticleAdmin)
admin.site.register(Category)
admin.site.register(Tag)
admin.site.register(Links)